<section class="ui top attached center aligned inverted segment">
  <div class="ui small circular image">
    {{ if isset .Site.Params "avatar" }}
    <img src="{{ .Site.Params.avatar }}">
    {{ else }}
    <img src="/img/avatar-ex.svg">
    {{ end }}
  </div>
  <h3 class="ui header">
    {{- .Site.Params.author -}}{{- i18n "blogAlias" -}}
    <div class="sub header" style="color: white;">{{ .Site.Params.motto }}</div>
  </h3>

  <div class="ui inverted horizontal list">
    {{ if gt (len (where .Site.RegularPages "Section" "==" "post")) 0 }}
    <a class="item" href="/post">
      <i class="archive icon" title="{{ i18n "archives" }}"></i>
    </a>
    {{ end }}
    <a class="item" href="/tags">
      <i class="tags icon" title="{{ i18n "allTags" }}"></i>
    </a>
    <a class="item" href="/categories">
      <i class="inverted cubes icon" title="{{ i18n "allCategories" }}"></i>
    </a>
  </div>

  <a id="tag-category-pop" class="ui red right corner label">
    <i class="pointing down icon" title="{{ i18n "clickToPopTagsAndCategories" }}"></i>
  </a>
</section>

{{ if .Site.Taxonomies.tags }}
<section class="ui attached center aligned inverted segment dream-header-tags dream-tags">
  {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
  <a class="ui label" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">{{ $name }}</a>
  {{ end }}
</section>
{{ end }}

{{ if .Site.Taxonomies.categories }}
<section class="ui attached inverted segment dream-categories">
  <div class="ui inverted accordion">
    {{ range $name, $taxonomy := .Site.Taxonomies.categories }}
    <div class="title">
      <i class="dropdown icon"></i>
      <a href="{{ "/categories/" | relLangURL }}{{ $name | urlize }}" class="item" style="color: white;">{{ $name }}</a>
    </div>
    <div class="content">
      <div class="ui link inverted list">
      {{ range $taxonomy.Pages }}
      <div class="item" style="padding-left: 24px;">
        <i class="cocktail icon"></i>
        <div class="content">
          <a href="{{ .Permalink }}" class="item">{{ .LinkTitle }}</a>
        </div>
      </div>
      {{ end }}
      </div>
    </div>
    {{ end }}
  </div>
</section>
{{ end }}

<section class="ui bottom attached center aligned inverted segment">
    {{ if .Site.Params.siteStartYear }}
    <p>© {{ if eq now.Year .Site.Params.siteStartYear }}{{ now.Year }}{{ else }}{{ .Site.Params.siteStartYear }} - {{ now.Year }}{{ end }} {{ .Site.Title }}</p>
    {{ else }}
    <p>© {{ now.Year }} {{ .Site.Title }}</p>
    {{ end }}
    <p>Powered by <a href="https://gohugo.io/" target="_blank">Hugo</a> with theme <a href="https://github.com/g1eny0ung/hugo-theme-dream" target="_blank">Dream</a>.</p>
</section>
